﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BotonJXC.Util
{
    public class StatusComboBoxUtil
    {

        public static IList<ComboBoxItem> getAuditcblist(Status status)
        {
            IList<ComboBoxItem> items = new List<ComboBoxItem>();

            ComboBoxItem cbinull = new ComboBoxItem();
            cbinull.Text = "请选择";
            cbinull.Value = "-1";
            items.Add(cbinull);
            if ((status & Status.None) == Status.None)
            {
                ComboBoxItem cbi = new ComboBoxItem();
                cbi.Text = "未审核";
                cbi.Value = (Int32)Status.None;
                items.Add(cbi);
            }

            if ((status & Status.AuditPass) == Status.AuditPass)
            {
                ComboBoxItem cbi = new ComboBoxItem();
                cbi.Text = "已审核";
                cbi.Value = (Int32)Status.AuditPass;
                items.Add(cbi);
            }

            if ((status & Status.AuditNoPass) == Status.AuditNoPass)
            {
                ComboBoxItem cbi = new ComboBoxItem();
                cbi.Text = "拒审";
                cbi.Value = (Int32)Status.AuditNoPass;
                items.Add(cbi);
            }

            if ((status & Status.Revert) == Status.Revert)
            {
                ComboBoxItem cbi = new ComboBoxItem();
                cbi.Text = "回转";
                cbi.Value = (Int32)Status.Revert;
                items.Add(cbi);
            }

            return items;
        }

        public static IList<ComboBoxItem> getOutcblist(Status status)
        {
            IList<ComboBoxItem> items = new List<ComboBoxItem>();

            ComboBoxItem cbinull = new ComboBoxItem();
            cbinull.Text = "请选择";
            cbinull.Value = "-1";
            items.Add(cbinull);
            if ((status & Status.None) == Status.None)
            {
                ComboBoxItem cbi = new ComboBoxItem();
                cbi.Text = "未出库";
                cbi.Value = (Int32)Status.None;
                items.Add(cbi);
            }

            if ((status & Status.AuditPass) == Status.AuditPass)
            {
                ComboBoxItem cbi = new ComboBoxItem();
                cbi.Text = "已出库";
                cbi.Value = (Int32)Status.AuditPass;
                items.Add(cbi);
            }

            return items;
        }

        public static IList<ComboBoxItem> getIncblist(Status status)
        {
            IList<ComboBoxItem> items = new List<ComboBoxItem>();

            ComboBoxItem cbinull = new ComboBoxItem();
            cbinull.Text = "请选择";
            cbinull.Value = "-1";
            items.Add(cbinull);
            if ((status & Status.None) == Status.None)
            {
                ComboBoxItem cbi = new ComboBoxItem();
                cbi.Text = "未入库";
                cbi.Value = (Int32)Status.None;
                items.Add(cbi);
            }

            if ((status & Status.AuditPass) == Status.AuditPass)
            {
                ComboBoxItem cbi = new ComboBoxItem();
                cbi.Text = "已入库";
                cbi.Value = (Int32)Status.AuditPass;
                items.Add(cbi);
            }

            return items;
        }
    }
}
